{{ define "title" }}
{{ .Title }}
{{ end }}

{{ define "frontmenu" }}
<nav class="ui top secondary menu">
  <div class="item">
    <i class="inverted big link bullseye icon dream-flip-toggle" title="{{ i18n "flip" }}"></i>
  </div>
  <div class="item">
    <a href="/">
      <i class="inverted big link home icon" title="{{ i18n "home" }}"></i>
    </a>
  </div>
</nav>
{{ end }}

{{ define "main" }}
<div class="ui centered grid">
  <div class="fifteen wide mobile fifteen wide tablet eleven wide computer column post-list post-single-main">

    <section class="ui secondary top attached black segment">
      <a class="ui black right corner label" href="javascript:void(0)" onclick="savePostAsImg()">
        <i class="save icon"></i>
      </a>
      <header>
        <h1 class="ui header">
          {{ .Title }}
          <div class="sub header">@ {{ if isset .Params "author" }}{{ .Params.author }}{{ else }}{{ .Site.Params.author }}{{ end }} · {{ .Date.Format "Jan 2, 2006" }} · {{ .ReadingTime }} min read · {{ i18n "updateAt" }} {{ dateFormat "Jan 2, 2006" .Lastmod }}</div>
        </h1>
      </header>
      <article class="post-content" style="margin-top: 2rem; font-size: 1.4rem;">{{ .Content }}</article>
    </section>

    <footer class="ui secondary attached segment dream-tags">
      {{ if isset .Params "tags" }}
      {{ range $tag := .Params.tags }}
      <a class="ui label" href="{{ "/tags/" | relLangURL }}{{ $tag | urlize }}" title="{{ $tag }}">{{ $tag }}</a>
      {{ end }}
      {{ else }}
      <span>{{ i18n "noTag" }}</span>
      {{ end }}
    </footer>

    {{ if .Site.Copyright }}
    <footer class="ui secondary attached segment">
      {{ .Site.Copyright | safeHTML }}
    </footer>
    {{ end }}

    {{ if .Site.DisqusShortname }}
    <footer class="ui secondary bottom attached stacked segment post-disqus-area" data-html2canvas-ignore="true">
      <div id="disqus_thread"></div>
      <script>
      /**
      *  RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
      *  LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables*/
      /*
      */

      var disqus_config = function () {
      this.page.url = '{{ .Permalink }}';  // Replace PAGE_URL with your page's canonical URL variable
      this.page.identifier = '{{ .RelPermalink }}'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
      };

      (function() { // DON'T EDIT BELOW THIS LINE
      var d = document, s = d.createElement('script');
      s.src = 'https://' + '{{ .Site.DisqusShortname }}' + '.disqus.com/embed.js';
      s.setAttribute('data-timestamp', +new Date());
      (d.head || d.body).appendChild(s);
      })();
      </script>
      <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
    </footer>
    {{ end }}

  </div>
  <div class="fifteen wide mobile fifteen wide tablet four wide computer column">

    {{ partial "header.html" . }}

  </div>
</div>
{{ end }}
